﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html;charset=utf-8"%>
<%@ include file="/pub/includ.jsp"%>
<%
	String userId = (String)request.getSession().getAttribute(com.wing.common.Constants.SESSION_USER_ID); 
	String siteId = (String)request.getSession().getAttribute(com.wing.common.Constants.SESSION_SITE_ID);
%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<script type="text/javascript"
	src="<%=path %>/resources/js/shouye.js"></script>
<style type="text/css">
<!--
html,
body {
	height:100%;
	background: #790000;
	background: url(<%=imgPath %>/index/f.gif) repeat;
}
.menu { height:79px; background: url(<%=imgPath %>/index/r.gif) repeat-x; border-bottom:#4f5967 1px solid; width:100%; margin:0 auto; position:relative;}
.menu .logo { width:260px; height:49px; float:left;}
.login_logo{ width:124px; height:49px; float:left;color:#fff;}
.login_logo a{color:#fff}
.member{ float:left; margin:15px 0 0 20px; width:152px;}
.member img{ margin-right:5px;}
.member a{ line-height:25px;}
.menu .manu {
	float:right;
	margin-right:100px;
	overflow: hidden;
}

.menu .manu li { float:left; margin:15px 15px 2px 10px;list-style:none;}
.menu .manu li img{ border:0;}
.menu .manu li a img:hover{ margin-top:2px;}
.menu .manu li a:link,.menu .manu li a:visited {outline:none; blr:expression(this.onFocus=this.blur());}
.zhandian { height:26px; line-height:26px; font-size:12px; color:#FFF; width:auto; position:absolute; left:0; top:50px; }
.zhandian span { float:left; background:url(<%=imgPath %>/index/dqzd.gif) no-repeat right top; height:25px; font-size:12px; padding:0 40px 0 20px;}
.zhandian span a { text-decoration:none; color:#ddd;cursor:pointer}
.zhandian span a:hover { color:#F90;}
ul.selectable li {
	    float:left;   
	}
	ul.selectable li a {
	    display: block;
	    width: 60px;
	    height: 20px;
	    text-align:center;
	    color:#4f5967;
	    
	}
	ul.selectable li a:hover{
		text-decoration: none;
	    color:#fff;
	}
-->
</style>
<title></title>
</head>
<body style="">
				<div class="menu" >
				  <div class="login_logo">
					<div class="member">
						<img src="<%=imgPath %>/index/icon.gif" width="8" height="10" /><%=request.getSession().getAttribute(com.wing.common.Constants.SESSION_USER_NAME) %> &nbsp;&nbsp;<a href="#" onclick="logout()">[退出]</a>
					</div>
				  </div>
				  <div class="manu">
				     <ul>
				       <%if(com.wing.common.Constants.SYSTEM_SUPERADMIN_ID.equals(userId)){ %>
						  <li ><a onclick="openDialog('zdgldiv','/cms/site','站点管理');" href="#"><img src="<%=imgPath %>/index/xtgl_01.png" /></a></li>
						<%} %> 
						  <li ><a onclick="openDialog('pdgldiv','/cms/channel','频道管理');" href="#"><img src="<%=imgPath %>/index/xtgl_02.png" /></a></li> 
						  <li ><a onclick="openDialog('wzgldiv','/cms/article','文章管理');" href="#"><img src="<%=imgPath %>/index/xtgl_03.png" /></a></li>
						  <li ><a onclick="openDialog('cpdiv','/ext/products','产品管理');" href="#"><img src="<%=imgPath %>/index/xtgl_04.png" /></a></li>
						  <%if(com.wing.cms.domain.Site.SITE_YBL_ID.equals(siteId)){ %> 
						  <li ><a onclick="openDialog('pfgldiv','/ext/information','网站发布信息管理');" href="#"><img src="<%=imgPath %>/index/xtgl_05.png" /></a></li>
						  <%} %>
						  <li ><a onclick="openDialog('kjgldiv','/cms/layout','框架管理');" href="#"><img src="<%=imgPath %>/index/xtgl_06.png" /></a></li> 
						  <li ><a onclick="openDialog('mbgldiv','/cms/template','模板管理');" href="#"><img src="<%=imgPath %>/index/xtgl_07.png" /></a></li>  
						  <li ><a onclick="openDialog('pfgldiv','/cms/lookfeel','皮肤管理');" href="#"><img src="<%=imgPath %>/index/xtgl_08.png" /></a></li>
				       <%if(com.wing.common.Constants.SYSTEM_SUPERADMIN_ID.equals(userId)){ %>
						  <li ><a onclick="openDialog('gngldiv','/cms/fun','功能管理');" href="#"><img src="<%=imgPath %>/index/xtgl_09.png" /></a></li>
						<%} %> 
				     </ul>
				  </div>
				</div>
				<div class="zhandian">
					<span>
						<div style="float:left;width:150px">当前站点：<a href="#" onclick="ochangesite()" id="sitename" class="siteschange12"></a></div>
						<div  id="changesitediv"  style="float:left">
							<ul id="selectable" class="selectable">
							</ul>
						</div>
					</span>
				</div>
				<iframe id="workiframe" allowTransparency="true"  src="<%=path%>/sys/get/innerindex" style="width:100%;height:88%" scrolling="no" frameborder="0">
				</iframe>	
					
	<script type="text/javascript">
		$(document).ready(
			function()
			{
				initsites();
			}
		);
		function ochangesite() {
			var options = {};
			$( "#changesitediv" ).toggle( "slide", options, 500);
		};
		function cchangesite() {
			var options = {};
			$( "#changesitediv" ).hide( "slide", options, 500);
		};
		function changesite(siteId,siteName) {
			var url = "<%=path %>/cms/site/changesite";
			$.ajax({
			   type: "POST",
			   url: url,
			   data: "siteId="+siteId+"&siteName="+siteName,
			   success: function(rows){
			   		$("#sitename").text(siteName);
				    cchangesite();
				    document.getElementById("workiframe").src="<%=path%>/sys/get/innerindex";
			   }
			});
			
		};
		function initsites(){
			var url = "<%=path %>/cms/site/getsites";
			$.ajax({
			   type: "POST",
			   url: url,
			   data: "",
			   success: function(rows){
				    var siteId="";
				    var siteName="";
				    $.each(rows, function(i, n){
				    	if(i==0){
				    		siteId=n.id;
				    		siteName=n.site_name;
				    	}
			   	        $("<li onclick=\"changesite('"+n.id+"','"+n.site_name+"')\" title=\""+n.site_name+"\"><a>"+n.site_name+"</a></li>").appendTo("#selectable");
			        });  
			        <%if(request.getSession().getAttribute(com.wing.common.Constants.SESSION_SITE_ID)!=null && request.getSession().getAttribute(com.wing.common.Constants.SESSION_SITE_NAME)!=null){%>
						changesite("<%=request.getSession().getAttribute(com.wing.common.Constants.SESSION_SITE_ID) %>","<%=request.getSession().getAttribute(com.wing.common.Constants.SESSION_SITE_NAME) %>");
					<%}else{%>
						if(siteId!=""){
							changesite(siteId,siteName);
						}
					<%}%> 
			   }
			});
		}
		function openDialog(id,url,title){
			document.getElementById("workiframe").contentWindow.openDialog(id,url,title);
		}
		function logout(){
			$.ajax({
				url :"<%=path %>/sys/logout", //要访问的后台地址
			    type : 'get', //使用get方法访问后台
			    success : function(data){
		   			document.location.reload();
			    }
			});	 
		}
		
	</script>
</body>
</html>
